package utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by iss on 17/10/17.
 */
public class FileReader {

    public static void main(String[] args) throws IOException {

        String all = "18620938229 18620938442 18620931603 18620931545 18620937545 18620937574 18620925319 18620928906 18620921573 18620925214 18620920924 18620924526 18620929604 18620925646 18620927380 18620928734 18620927030 18620927744 18620940312 18620942923 18620942476 18620943997 18620942691 18620940607 18620942770 18620940825 18620943421 18620940206 18620943771 18620941660 18620940436 18620918544 18620932991 18620939467 18620934880 18620935124 18620939791 18620919505 18620938441 18620931321 18620930828 18620934043 18620937196 18620931673 18620930623 18620934183 18620930240 18620933849 18620936191 18620939634 18620932604 18620938812 18620938320 18620938413 18620938397 18620934292 18620936270 18620934820 18620938934 18620930464 18620937357 18620919514 18620932958 18620939249 18620934773 18620934892 18620934984 18620939031 18620925386 18620926840 18620925560 18620922374 18620922363 18620920340 18620924452 18620929369 18620923947 18620926807 18620923298 18620928490 18620912436 18620915482 18620915491 18620914627 18620912105 18620918081 18620917078 18620913861 18620913269 18620913068 18620891516 18620912790 18620911628 18620912960 18620912552 18620914735 18620915044 18620911621 18620917396 18620897259 18620914532 18620911794 18620915576 18620915735 18620917390 18620916443 18620913681 18620913610 18620916476 18620914043 18620913116 18620917501 18620916515 18620916210 18620891373 18620856168 18620890685 18620899363 18620890386 18620882813 18620913438 18620917595 18620917851 18620915709 18620913414 18620913786 18620916760 18620917160 18620915550 18620911983 18620915157 18620915695 18620914309 18620915256 18620915594 18620915825 18620910660 18620914253 18620914843 18620914327 18620914659 18620916757 18620912167 18620916654 18620913329 18620916209 18620914797 18620911417 18620913929 18620915059 18620917882 18620915324 18620899502 18620912117 18620915335 18620911751 18620916128 18620890583 18620895823 18620890936 18620886851 18620915182 18620911049 18620913041 18620916179 18620916943 18620913325 18620913421 18620915379 18620914145 18620912395 18620910775 18620910174 18620910743 18620917269 18620912543 18620913764 18620891023 18620896173 18620910851 18620917716 18620911670 18620917301 18620912149 18620917498 18620917547 18620917609 18620915732 18620913307 18620917545 18620916951 18620915003 18620910404 18620916560 18620910312 18620917394 18620911178 18620915578 18620913619 18620891193 18620890301 18620913982 18620911405 18620914072 18664700809 18664680194 18664678681 18664678610 18664676342 18664678584 18664676630 18664679962 18664678759 18664679236 18664701486 18664698008 18664698942 18664677332 18664676531 18664699341 18664699843 18664700447 18664700523 18664698061 18664679642 18664679372 18664679690 18664678414 18664702202 18664676649 18664679089 18664678601 18664678847 18664678047 18664679460 18664679735 18664678818 18664676545 18664698174 18664700846 18664700582 18664698341 18664698456 18664698470 18664701118 18664698669 18664700494 18664699065 18664699295 18664699374 18664680207 18664701732 18664699059 18664700113 18664700456 18664702156 18664701949 18664698365 18664678394 18664677484 18664678613 18664677487 18664678473 18664677727 18664678165 18664697754 18664700748 18664699871 18664698423 18664679135 18664677673 18664676912 18664677906 18664676914 18664679946 18664678064 18664677692 18664699985 18664698379 18664699790 18664699539 18664699117 18664698463 18664701427 18664698346 18664677410 18664679283 18664679535 18664676023 18664679353 18664678691 18664679067 18664677494 18664678379 18664678876 18664677380 18664680149 18664701664 18664700754 18664698351 18664697771 18664698706 18664700591 18664700561 18664680442 18664679270 18664678287 18664678272 18664679424 18664678816 18664677227 18664680425 18664701643 18664697905 18664699623 18664698385 18664699418 18664700584 18664699124 18664698730 18664697792 18664677172 18664679630 18664677106 18664677834 18664678156 18664679479 18664678714 18664679549 18664679153 18664697943 18664698310 18664698647 18664698175 18664702159 18664702137 18664701693 18664701564 18664700913 18664698005 18664700241 18664701661 18664679125 18664677535 18664677664 18664679401 18664677113 18664677037 18664688183 18664688194 18664688241 18664688464 18664688564 18664688630 18664688671 18664688692 18664688702 18664688804 18664688829 18664689035 18664689041 18664689083 18664689145 18664689164 18664689190 18664864610 18664864659 18664864662 18664864675 18664864691 18664864734 18664864743 18664864757 18664864762 18664621550 18664621646 18664621742 18664621747 18664621754 18664622016 18664622089 18664622107 18664622125 18664622148 18664622154 18664622181 18664622343 18664622374 18664622387 18664622434 18664622444 18664622453 18664622715 18664622854 18664622983 18664623005 18664623024 18664623045 18664623305 18664623340 18664623358 18664623423 18664623516 18664623521 18664623544 18664623683 18664623819 18664623924 18664623934 18664624013 18664624093 18664624163 18664624164 18664624219 18664624224 18664624270 18664624273 18664624274 18664624336 18664624345 18664624491 18664624493 18664624513 18664624594 18664624687 18664624734 18664624775 18664624838 18664624851 18664624929 18664625026 18664625067 18664625147 18664625294 18664625348 18664625469 18664625482 18664625525 18664625554 18664625626 18664625687 18664625694 18664625815 18664625837 18664625934 18664625974 18664626047 18664626289 18664626413 18664626418 18664626465 18664626529 18664626940 18664627039 18664627164 18664627169 18664627227 18664627245 18664627384 18664627421 18664627437 18664627475 18664627658 18664627725 18664627743 18664627814 18664627874 18664628008 18664628030 18664628041 18664628045 18664628132 18664628263 18664628339 18664628357 18664628464 18664628482 18664628489 18664628550 18664628651 18664628721 18664628756 18664628870 18664629006 18664629214 18664629224 18664629296 18664629397 18664629435 18664629467 18664629506 18664629591 18664629710 18664629719 18664629732 18664629792 18664629859 18664629961 18664630162 18664630173 18664630304 18664630363 18664630412 18664630445 18664630456 18664630503 18664630632 18664630754 18664630783 18664630925 18664630931 18664630941 18664631020 18664631304 18664631340 18664631442 18664631479 18664631491 18664631493 18664631510 18664631518 18664631614 18664631716 18664631747 18664631836 18664631914 18664631958 18664631981 18664632136 18664632194 18664632237 18664632278 18664632326 18664632346 18664632472 18664632536 18664632635 18664632669 18664632734 18664632736 18664632845 18664632910 18664632954 18664632980 18664632990 18664633026 18664633074 18664633248 18664633339 18664633413 18664633440 18664633484 18664633745 18664633749 18664634057 18664634084 18664634154 18664634156 18664634167 18664634176 18664634184 18664634279 18664634427 18664634561 18664634664 18664634672 18664634674 18664634679 18664634742 18664634754 18664634863 18620915229 18620910597 18664688141 18664756314 18664756342 18664756389 18664756398 18664756426 18664756445 18664756446 18664756502 18664756520 18664756532 18664756557 18664756573 18664756613 18664756649 18664756652 18664756704 18664756749 18664756828 18664756853 18664756914 18664756957 18664756964 18664756981 18664756986 18664757018 18664757036 18664757040 18664757086 18664757093 18664757110 18664757145 18664757163 18664757202 18664757225 18664757236 18664757270 18664757303 18664757310 18664757380 18664757383 18664757387 18664757402 18664757421 18664757439 18664757467 18664757476 18664757523 18664757529 18664757587 18664757605 18664757613 18664757640 18664757682 18664757692 18664757716 18664757735 18664757742 18664757780 18664757783 18664757784 18664757825 18664757851 18664757861 18664757863 18664757898 18664757926 18664757936 18664757944 18664757976 18664758001 18664758028 18664758061 18664758065 18664758087 18664758101 18664758104 18664758105 18664758163 18664758173 18664758194 18664758235 18664758244 18664758247 18664758249 18664758290 18664758304 18664758308 18664758319 18664758326 18664758334 18664758369 18664758385 18664758392 18664758394 18664758395 18664758413 18664758448 18664758474 18664758492 18664758496 18664758514 18664758525 18664758576 18664758642 18664758687 18664758692 18664758716 18664758736 18664758752 18664758786 18664758863 18664758910 18664758953 18664758957 18664758974 18664759023 18664759041 18664759052 18664759078 18664759158 18664759207 18664759244 18664759250 18664759270 18664759291 18664759294 18664759327 18664759337 18664759344 18664759439 18664759458 18664759460 18664759486 18664759489 18664759495 18664759503 18664759563 18664759605 18664759624 18664759640 18664759646 18664759659 18664759672 18664759680 18664759710 18664759718 18664759742 18664759754 18664759791 18664759867 18664759890 18664759908 18664759987 18664760102 18664760142 18664760194 18664760282 18664760291 18664760317 18664760391 18664760419 18664760434 18664760448 18664760453 18664760491 18664760544 18664760658 18664760663 18664760679 18664760686 18664760717 18664760783 18664760812 18664760836 18664760874 18664760937 18664760944 18664760951 18664760994 18664761005 18664761040 18664761041 18664761071 18664761154 18664761202 18664761229 18664761272 18664761301 18664761306 18664761328 18664761336 18664761339 18664761342 18664761361 18664761369 18664761389 18664761417 18664761430 18664761469 18664761493";

        String[] arr = all.split(" ");

        Set<String> result = new HashSet<>();

        Set<String> allSet = new HashSet<>();
        Collections.addAll(allSet, arr);
        Set<String> usedSet = new HashSet<>();

        File file = new File("/Users/iss/uuu.txt");
        java.io.FileReader fr = new java.io.FileReader(file);

        BufferedReader br = new BufferedReader(fr);

        String str = br.readLine();

        while (str != null) {
            try {
                str = str.substring(str.indexOf(")") + 2, str.length() - 1);
                if (str.length() == 11) {
                    usedSet.add(str);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }

            str = br.readLine();
        }

        br.close();
        fr.close();

        result.clear();
        result.addAll(allSet);
        result.removeAll(usedSet);

        System.out.println("total = " + allSet.size());
        System.out.println("used = " + usedSet.size());
        System.out.println("remain = " + result.size());

        int count = 0;
        for (String s : result) {
            count++;

            if (count == 100) {
                count = 0;
                System.out.println();
            }

            System.out.print(s + " ");
        }
    }

}
